﻿
namespace MyFirstCastle.Web.Controllers
{
    using System;

    using Castle.MonoRail.Framework;

    [Layout("default"), Rescue("generalerror")]
    public class HomeController : SmartDispatcherController
    {
        public void Index()
        {
            RenderView("index");
        }

        //browse: home/DataToView.aspx
        public void DataToTheView()
        {
            PropertyBag["name"] = "John Doe";
            PropertyBag["today"] = DateTime.Now;

            RenderView("data");
        }

        //browse: home/ThrowError.aspx
        public void ThrowError()
        {
            throw new Exception("This is an exception");
        }
    }

}
